// 中国标准时间转字符串，返回格式：2020-7-17 16:49
export function formatDateTime(date){
	var y = date.getFullYear();
	var m = date.getMonth() + 1;
	m = m < 10 ? ('0' + m) : m;
	var d = date.getDate();
	d = d < 10 ? ('0' + d) : d;
	var h = date.getHours();
	h=h < 10 ? ('0' + h) : h;
	var minute = date.getMinutes();
	minute = minute < 10 ? ('0' + minute) : minute;
	var second=date.getSeconds();
	second=second < 10 ? ('0' + second) : second;
	return y + '-' + m + '-' + d+' '+h+':'+minute;
}

// 中国标准时间转字符串，返回格式：2020-7-17
export function formatDate(date){
    var myyear = date.getFullYear();
    var mymonth = date.getMonth() + 1;
    var myweekday = date.getDate();
 
    if (mymonth < 10) {
        mymonth = "0" + mymonth;
    }
    if (myweekday < 10) {
        myweekday = "0" + myweekday;
    }
    return (myyear + "-" + mymonth + "-" + myweekday);
}